<div class="container-fluid" ng-show="detailId=='0'">
  <div class="card card-query">
    <div class="content">
      <div class="row">
        <div class="col-md-2">
          <h4 class="title">分类</h4>
          <div class="form-group">
            <input type="text" ng-model="queryParams.category" class="form-control" placeholder="输入定义分类">
          </div>
        </div>
        <div class="col-md-2">
          <h4 class="title">标识</h4>
          <div class="form-group">
            <input type="text" ng-model="queryParams.key" class="form-control" placeholder="输入定义标识">
          </div>
        </div>
        <div class="col-md-8">
          <h4 class="title">名称</h4>
          <div class="input-group form-group">
            <input type="text" ng-model="queryParams.name" class="form-control" placeholder="输入定义名称">
            <span class="input-group-btn">
              <button type="button" class="btn btn-info" ng-click="queryDefinition()">搜索</button>
              <button type="button" class="btn btn-info" ng-click="importDefinition()">导入</button>
            </span>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="card">
    <div class="content">
      <table ng-table="tableOptions" class="table table-striped ng-table">
      </table>
    </div>
  </div>
</div>

<div class="container-fluid" ng-if="detailId!='0'">
  <div class="card card-detail">
    <div class="header">
      <h4 class="title">
        <span class="text-info right-split">v{{selectedItem.version}}</span>{{selectedItem.name}}
        <button type="button" class="btn btn-warning pull-right" ng-click="gotoList()">返回列表</button>
      </h4>
    </div>
    <div class="content">
      <div class="row">
        <div class="col-md-10">
          <span class="property"><label>ID:</label>{{selectedItem.id}}</span>
          <span class="property"><label>版本:</label>{{selectedItem.version}}</span>
          <span class="property"><label>名称:</label>{{selectedItem.name}}</span>
          <span class="property"><label>标识:</label>{{selectedItem.key}}</span>
          <span class="property"><label>创建时间:</label>{{selectedItem.createTime}}</span>
          <span class="property"><label>分类:</label>{{selectedItem.category}}</span>
          <span class="property"><label>最后修改时间:</label>{{selectedItem.lastUpdateTime}}</span>
          <span class="property"><label>关联表:</label>{{selectedItem.relationTable}}</span>
        </div>
        <div class="col-md-2">
          <button type="button" class="btn btn-info btn-block" ng-click="createInstance(selectedItem.id)">启动</button>
        </div>
      </div>
    </div>
  </div>


  <div class="card card-detail">
    <div class="content">
      <div class="nav-tabs-navigation">
        <div class="nav-tabs-wrapper">
          <ul uib-tabset active="active" type="tabs">
            <uib-tab index="0" heading="表单字段" select="queryMetadata(detailId)"></uib-tab>
            <uib-tab index="1" heading="布局设计" select="queryMetadata(detailId)"></uib-tab>
            <uib-tab index="2" heading="表单实例" select="queryInstance(detailId)"></uib-tab>
          </ul>
        </div>
      </div>
      <div class="tab-content">
        <div class="tab-pane" ng-class="{'active':active==0}">
          <table ng-table="fieldTableOptions" class="table table-striped ng-table">
          </table>
        </div>
        <div class="tab-pane" ng-class="{'active':active==1}">
          <table ng-table="layoutTableOptions" class="table table-striped ng-table">
          </table>
        </div>
        <div class="tab-pane" ng-class="{'active':active==2}">
          <table ng-table="instanceTableOptions" class="table table-striped ng-table">
          </table>
          <br/>
          <button type="button" class="btn btn-info btn-block" ng-click="gotoInstanceList(detailId)">查看全部表单实例
          </button>
        </div>
      </div>
    </div>
  </div>
</div>

<script type="text/ng-template" id="form-layout-watch.html">
  <iframe src="{{url}}" width="100%" height="500" frameborder="no" border="0" marginwidth="0" marginheight="0"></iframe>
</script>